/*
    宏和函数区别演示
*/
#include <stdio.h>
#define ABS(n)	n >= 0 ? n : 0 - n
#define SUB(x,y)	((x) - (y))	
int ads(int num) {
    if(num >= 0) {
	return num;
    }
    else {
	return 0 - num;
    }
}
int main() {
    int num = 0;
    printf("请输入一个整数：");
    scanf("%d",&num);
    printf("绝对值是：%d\n",ads(num));
    printf("绝对值是：%d\n",ABS(num));
    printf("SUB(20 - 10) = %d\n", SUB(20,10));
    printf("30 - SUB(20 - 10) = %d\n", 30 - SUB(20,10));
    printf("SUB(20, 15 - 5) = %d\n", SUB(20,15 - 5));
    return 0;
}
